package com.jasonli.dao;

import com.jasonli.domain.Car;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CarDao {

    //    添加购物车
    @Insert("insert into car values(null,#{cid},#{pname},#{price},#{onumber},#{money},#{odate})")
    public void save(Car car);

    @Update("update car set onumber = #{onumber} where chrid = #{chrid}")
    public void update(Car car);

    //    根据购物车chrid删除
    @Delete("delete from car where chrid = #{chrid}")
    public void delete(Integer chrid);

    //    根据顾客cid查询
    @Select("select * from car where cid = #{cid}")
    public List<Car> getByCid(Integer cid);


}
